package org.sunyu.sunyutest.javase1;

import java.util.ArrayList;

/**
 * @Author: Ben
 * @Date: 2019/7/12 8:32
 */
public class Test71 {
//7. 打印九九乘法表。（10分）
    public static void main(String[] args) {
        ArrayList<String> arrayList=new ArrayList();
        for (int i = 1; i <=9 ; i++) {
            for (int j = 1; j <=i ; j++) {
                arrayList.add(String.format("%s*%s=%s ",i,j,i*j));
//                System.out.print(i+"*"+j+"="+i*j+" ");
            }
        }

        int a=0;
        for (int i = 1; i <=9 ; i++) {
            for (int j = 1; j <=i ; j++) {
                System.out.print(arrayList.get(a));
//                System.out.print(i+"*"+j+"="+i*j+" ");
                a++;
            }
            System.out.println();
        }

//        Iterator iterator=arrayList.iterator();
////        while(iterator.hasNext()){
////            System.out.print(iterator.next());
////        }
    }
}
